Programming :: Programmatically Getting Standard File Dialog
Jul 14, 2010
Is it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).
Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).
View 4 Replies
ADVERTISEMENT
Jun 3, 2010
I would like to associate my program with several file extensions programatically.
Everything I've been finding online is how a user would set a file association, does anyone know how to do this progormatically (bash, C++, etc)?
I would mostly like to get this to work with Gnome, but KDE would be nice as well.
View 3 Replies
View Related
May 4, 2009
I am developing a application in which i have to show the name of default browser and mail client. i want to run this application on RedHat, SuSE, Mandriva, and Ubuntu. I have checked similar threads but not found any useful information.
View 8 Replies
View Related
Oct 3, 2010
Given a matrix with 0,1 entries, how can I create a graphic in linux such that we have a black square or pixel if the entry is one and white otherwise?
For example, if the matrix is:
0001000
0011100
0111110
0000000
then I want a graphic that looks like:
[code]....
I will be working with many large matrices, e.g. 1000x1000, or 5000x1000 so I need to do this automatically.
View 6 Replies
View Related
Nov 11, 2010
We make everyday a DB Mysql backup on Linux redhat Enterprise. We are using a bash shell script (and putting it in the crontab) to execute it automatically everyday. We added a line to this script telling, once the backup has completed, to find old backup files (stored on hard disk after each backup) older than x days to remove them. We use the find command (search for file type) with the mtime option and in combination with rm command. Everything runs ok but we also want to add some new code to the same line: If find command cannot find anything or fails, for example if it cannot delete file or fails, send the error message (standard error output) to an error file (like error000001 and increasing) and mail the errorxxxx file to an email address for example to admin@companyname.com. What would be the code for this issue to add it to our find command in the same bash shell script??
View 2 Replies
View Related
Dec 7, 2009
I have an application for loading data into MySQL table using php, through excel-Reader. php is set up on the localhost and the web-page is available from: [url]
The code of xlr2.php:
When I open the page, I get the message to choose a file with the file-dialog box and the notice as:
Notice: Undefined index: action in /var/www/html/xlr/xlr2.php on line 10
Default Action:
Choose a file to Load into MySQL:
Why so? I am selecting file from ("/home/lx/myDocuments/tech/excel/smslist.xls"), but the warning says that [failed to open stream: No such file or directory in /var/www/html/xlr/xlr2.php on line 33]. A different directory than I selected.
View 1 Replies
View Related
May 5, 2010
I am envisioning a dialog menu with 2 sections, the top 2/3 a menu, then the bottom 1/3 is a message box. When you highlight a menu item it gives you a description of what it does in the message box. However I am not sure it is possible. Can this be done in BASH?
View 2 Replies
View Related
Apr 6, 2011
Anyway, here is something that is puzzling me and cannot think up a good way around it: I call the constructor and show elements of LoginDialog in the constructor of my QMainWindow, like this:
PHP Code:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); LoginDialog *lid = new LoginDialog(this); lid.show();}
LoginDialog is a QDialog and it does show up on application start... but...
It is not active! The QMainWindow is the active window, even if I put lid->activateWindow();
So, the question is: how do I pop up this dialog on application start in such a way that it will show the LoginDialog on startup as active window?
View 4 Replies
View Related
Feb 5, 2011
I cannot seem to get if else statements to work. if $choice == Dog then i want it to say "you selected Dog" The variable choice has the value Dog in it as proved at the end by echo "yes $choice is $choice" following the error Code: ./test.sh: 37: [$choice: not found How do i get the conditional statement to work? What's wrong here? This is the full script:
Code:
#! /bin/sh
: ${DIALOG=dialog}
: ${DIALOG_OK=0}
[code]....
View 7 Replies
View Related
Jun 28, 2009
I want to display an un-intrusive graphical dialog to notify the workstation user that a bash script has finished running. It should be "top level", so visible to the user when it appears but should not grab focus, so the user can continue working in the current window and dismiss the notification when convenient. Researching gdialog, xdialog, xmessage and zenity it seems none of them can do this; they all grab focus.
View 3 Replies
View Related
Dec 14, 2010
How can I make radiolist dialog which content so many options what is the value of the variable?Quote:
echo "How many options?"
read=VAR
dialog --title "sdf" --backtitle "sdff" --radiolist "ffdsfsd" 15 60 5 "1" "first" on "2" "second" off "3" "third" off "4" "fourth" off etc..
I must explode dialog in loop and add options? or something like that?
View 2 Replies
View Related
Dec 10, 2010
On both my 32-bit laptop (openSUSE 11.3) and my 64-bit desktop (openSUSE 11.2) I have been unable to find out how to prevent seeing all the "hidden files" when opening files in many applications, including (for example) GIMP, Xournal, OpenOffice, gedit.In the Control Centre "File management" options "Show hidden and backup files" is NOT checked in "File Management Preferences.
View 2 Replies
View Related
Jul 21, 2010
Where is the location of the header files for the c++ standard library?
I assume that they were installed by gnu g++, please correct me if i'm wrong.
I'm running ubuntu 10.04 with g++ 4.4.
I looked in /usr/lib/gcc/i486-linux-gnu/4.4/include, but this directory contains only the following:
Code:
Which doesnt seem to include the really basic things like iostream, for example.
Where can I take a look at the header files for these standard c++ libraries?
View 2 Replies
View Related
Jan 7, 2011
Whenever, I successfully save a new document, the document's icon does not display in the KDE File Dialog until OpenOffice restarts. The document exists, because trying to do a "Save As" on it produces a dialog that states if one wants to overwrite the document. Also, trying to export a PDF twice has the same outcome.
OpenOffice 3.2.1
scim 1.4.7-174.1
KDE 4.4.4
openSUSE 11.3 64-bit
View 1 Replies
View Related
Sep 22, 2010
I am making a program to reverse a string
Code:
#include<stdio.h>
int main ()
{
int i,j;
[Code].....
View 5 Replies
View Related
Aug 25, 2011
I suspect this is a Gnome 3 problem and not a Fedora problem, but I have no way to separate the two here. I cannot upload an image from my computer to Weebly or to Google Plus, but strangely enough, I can upload one to Picasa. The sequence of actions goes something like this:
1. Open Weebly editing interface, add a picture element, click on the element to edit/add a picture. It then gives you a choice: from your local computer, from the web, etc.
2. Click on 'from local computer' and my computer opens the Open File Dialog Window.I am guessing that is its name, it is the same window you get when opening a file in any other application, like Gedit or LibreOffice.
3. Navigate to the image I want to upload and double click on it or select 'Open'.
4. Nothing happens.
I am able to upload images from my laptop, running Linux Mint 11 with Gnome 2.
It sounds to me like the Open File Window is not passing on the necessary information to the browser. I have no idea why it works in Picasa and not in Google+ or Weebly.
I don't really expect anyone to have a solution just yet, but I wanted to mention it somewhere, and I didn't see any Gnome.org forums. On the other hand, if someone does have a solution, great.
This is by no means a knock on Gnome 3, it is fine with me and I Iike it a lot more than I thought I would.
View 2 Replies
View Related
Jan 12, 2010
i have installed xampp 1.7.3 in ubuntu 9.10 and if i try to open the .php file in the browser it asks the me where to save the file and browser opens the source code rather than parsing the php file.
View 9 Replies
View Related
May 10, 2011
In both Slackware 12.2 (gtk 2.12.12) and Slackware 13.1 (gtk 2.18.9), the left-hand side panel of the GTK file chooser (File Open and Save) dialog box displays three sections. The first section contains two options: Search and Recently Used. The second section contains several options. The third section are personal bookmarks I have created and stored in $HOME/.gtk-bookmarks.
Modifying the bookmarks section is straightforward, but I am searching for ways to modify the first and second sections.
1. In both 12.2 and 13.1, the second section shows the following: $HOME directory, Desktop, File System. In 13.1, several mount points now appear. I think the criterion being used is the mount point being outside the main root tree. Several of these mount points are configured in fstab with the noauto option and are user mounted only as necessary. I do not want any of these volumes appearing in that section nor the Desktop option. Is there a way to exclude those volumes and options?
2. In that same second section are two mounted volumes from a second internal drive. Those two partitions are part of my bookmarks. In 12.2 those two partitions appeared in the bookmarks section. In 13.1 those two bookmarks are ignored and instead appear in the second section. I prefer those two points appear in my bookmarks section because I prefer my own labels rather than mount point names. Is there a way to do that?
3. Is there an option in $HOME/.config/gtk-2.0/filechooser.ini to control the width of the side panel?
View 1 Replies
View Related
Apr 20, 2011
I have a data in a column.
Code:
I want to calculate average and standard deviation. As first step I want to calculate average for the data than calculate (del=data - avg) for all the data.
I suppose get
Code:
For this I use AWK and the code goes like this
Code:
But I get different answers.
Code:
Why the answers are so different? since this is wrong I can not continue calculating the standard deviation.
View 6 Replies
View Related
Mar 26, 2010
I'm trying to pull out sections from a bunch of files. For one file, I use:
Code:
sed '/string1/,/string2/ !d' <filename.ext >newfilename.ext
to pull out everything between two strings in the original file and put them in a new file.
[code]....
View 3 Replies
View Related
Feb 17, 2010
I have created two threads:
Thread 1 and thread 2
In the main thread, i have put up a timer which generates a signal periodically when it expires, which reults in execution going to signal catcher function.when this function is invoked, under certain condition it goes to thread 1 and under another condition it goes to thread 2. The problem lies here that when it goes to thread2,i have a loop to process but it doesnt come out of the loop and hence from thread2, even though timer has expired.
View 2 Replies
View Related
Feb 22, 2011
Is there any document or specification like the Linux Standard Base for the naming convention of commandline options?
View 3 Replies
View Related
Jan 5, 2010
The code is attached..My intention is that getchar which usually blocks,should come out after 5 seconds(VTIME).But this is not happening..can anyone tell me the mistake that I make..?
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
[code]...
View 3 Replies
View Related
Sep 4, 2010
From cat.c in GNU coreutils:
Code:
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.
[Code]...
I don't remember ever seeing this in any examples I've ever seen, so I'm sure I've never seen an explanation of this.
View 1 Replies
View Related
Aug 23, 2010
Is there some sort of standards file path convention for installing softwares that I could follow through? For example, I just learnt how to build Nginx from source. But the default binary path set by nginx is "/usr/local/nginx/sbin". I have seen a couple of tutorials which they specify the location of the installed binary and it is very different from those usual default paths. Thus, got me thinking whether is there some form of file path convention that I should follow?Is there some kind of list which states where do those packages on Debian.org Repository usually installed to?
View 6 Replies
View Related
May 20, 2010
I want to show the contents of a file on Dialog box for which I have use the "--textbox" dialog and "--tailbox" dialog.
But it doesn't show the whole contents of file, it only shows some of the data.
How do I get it to show the entire file data?
View 1 Replies
View Related
Dec 22, 2010
Whenever I edit a spreadsheet in Gnumeric, I have to have an argument about saving the edited version. First, it says it wants to save it in Gnumeric's XML format instead of whatever format I opened it in, and then I get a dialog warning me the file already exists,is it OK to overwrite it? All my spreadsheets are either .odt or .csv. I just want to be able to open, edit and save without an argument every time. It's like telling a child that it's bed time and having the same argument every night, and it's getting on my nerves.Is there a setting where I can get gnumeric to obediently save the edited version, or do I just have to put up with the slower opening times of LibreOffice instead?
View 4 Replies
View Related
Jun 21, 2010
I have created virtual cd (using damoen tools) for opensuse 11.2 installation from standard iso file and that installed installer for opensuse in my C drive and asked me to restart. After I restarted it gave me two options during boot, vista and opensuse 11.2 installer. I tried installing opensuse 11.2 from boot option and it asked me for language>country>installation. From the installation window which gave three options, I selected installation option and after preparing system for installation it asked me about sda location....I had separate partition which I selected and after that it is asking me for source which I don�t know what it is. I tried few things but no success and then tried to get in to vista but unfortunately it is not booting in vista as well and takes me though the same process explained above.
So both my boot options are trying to install opensuse 11.2 and stops at provide source window. So in a nutshell I am stuck and not able to use my system. For your information I don�t have vista installation cd so I can�t repair vista.
View 3 Replies
View Related
Jan 10, 2011
I have a weird problem with one of my servers. When system is booted and right before I should se "INIT 2.86 starting..." message, all the messages disappear. Only kernel messages get logged to console and later login prompt, but nothing in betweek (there are 20+ services starting successfully, just without emitting a single character).I checked /proc/PID/fd of the boot script (in my case called /etc/rc.d/rc.boot but that does not matter).
The only significant difference in hardware to other servers is that this one runs RV350 AP [Radeon 9600] graphic card.Now, my question is: where could those FDs go or why are they not opened?Does anyone have a clue about this, or a hint?
View 5 Replies
View Related
Jan 21, 2010
I have changed the preference in the Nautilus file manager/browser to "Single click to activate items" and it works.
However, when I run an application, say Totem Movie Player, and select Movie/Open I am presented with a Nautilus like file navigation dialog. This is a common dialog to most Gnome applications - probably part of Gnome. Problem is, the dialog does not respect my "single click..." preference.
I have tested this in Ubuntu 9.10, 10.04 alpha 2 and CentOS 5.4 - I do not think it is distribution related.
View 2 Replies
View Related