Well, I don't really know what to say about this. 
The latest patch has way too much crap in it to be included in main trunk. And 
if anything like this would be included, it should be possible to copy all the 
other fields also. eg. sub-menu where to select field to copy (and the whole 
row). 

--RZ

-- 
impliment copy file name in search
https://bugs.launchpad.net/bugs/464185
You received this bug notification because you are a member of LinuxDC++
Team, which is subscribed to LinuxDC++.

Status in Linux DC++: New

Bug description:
can someone give me help on how to impliment the above mentioned item in the 
search please or impliment it in the client as can be useful to be able just 
copy filenames from the search window?

am uncertain as how to complete this: ?

glade/search.glade:

      <widget class="GtkMenuItem" id="copyFileName">
        <property name="visible">True</property>
        <property name="label" translatable="yes">_Copy FileName</property>
        <property name="use_underline">True</property>
      </widget>
    </child>



linux/search.cc:

        g_signal_connect(getWidget("copyFileName"), "activate", 
G_CALLBACK(onCopyFileNameClicked_gui), (gpointer)this);



void Search::oncopyFileNameClicked_gui(GtkMenuItem* item, gpointer data)
{
        Search *s = (Search *)data;

        if (gtk_tree_selection_count_selected_rows(s->selection) > 0)
        {
                int64_t size;
                string magnets, magnet, filename, tth;
                GtkTreeIter iter;
                GtkTreePath *path;
                GList *list = 
gtk_tree_selection_get_selected_rows(s->selection, NULL);

                for (GList *i = list; i; i = i->next)
                {
                        path = (GtkTreePath *)i->data;
                        if (gtk_tree_model_get_iter(s->sortedFilterModel, 
&iter, path))
                        {
                                bool parent = 
gtk_tree_model_iter_has_child(s->sortedFilterModel, &iter);

                                do
                                {
                                        filename = 
s->resultView.getString(&iter, "Filename");
                                        size = 
s->resultView.getValue<int64_t>(&iter, "Real Size");
                                        tth = s->resultView.getString(&iter, 
"TTH");
                                        magnet = 
WulforUtil::makeMagnet(filename, size, tth);

                                        if (!magnet.empty())
                                        {
                                                if (!magnets.empty())
                                                        magnets += '\n';
                                                magnets += magnet;
                                        }
                                }
                                while (parent && 
WulforUtil::getNextIter_gui(s->sortedFilterModel, &iter, TRUE, FALSE));
                        }
                        gtk_tree_path_free(path);
                }
                g_list_free(list);

                if (!magnets.empty())
                        
gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), 
magnets.c_str(), magnets.length());
        }
}





linux/search.hh:

                static void onCopyFileNameClicked_gui(GtkMenuItem *item, 
gpointer data);

_______________________________________________
Mailing list: https://launchpad.net/~linuxdcpp-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~linuxdcpp-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to